﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Util;
using System.Xml;

namespace BLO
{
    public class BlogOption
    {
        XMLOption options;
        
        public BlogOption(String filePath)
        {
            options = new XMLOption(filePath);
        }

        public String Layout
        {
            get 
            {
                XmlNode option = options.SelectNodes("/Modules/Layout").Item(0);
                if (option == null)
                {
                    // Return default value.
                    return "Layout/3A.css";
                }
                else
                {
                    return "Layout/" + option.InnerText + ".css";
                }
            }
        }

        public String Theme
        {
            get
            {
                XmlNode option = options.SelectNodes("/Modules/Theme").Item(0);
                if (option == null)
                {
                    // Return default value.
                    return "Theme/Default.css";
                }
                else
                {
                    return "Theme/" + option.InnerText + ".css";
                }
            }
        }
    }
}